//
//  NSString+RBExtension.m
//  OrderFood
//
//  Created by xiaofang wang on 2018/12/29.
//  Copyright © 2018年 zhiyuan. All rights reserved.
//

#import "NSString+RBExtension.h"

@implementation NSString (RBExtension)
+ (BOOL)rb_isEmptyString:(NSString *)str {
    if (str == nil || str == NULL) {
        return YES;
    }
    if ([str isKindOfClass:[NSNull class]]) {
        return YES;
    }
    
    if ([str isEqualToString:@"(null)"]) {
        return YES;
    }
    
    if ([str isEqualToString:@"<null>"]) {
        return YES;
    }
    
    if ([str isEqualToString:@""]) { //空字符串也是空
        return YES;
    }
    if ([str length] == 0) { //空
        return YES;
    }
    
    //去除空格之后,长度为0 也为空
    if ([[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length] == 0) {
        return YES;
    }
    
    return NO; //非空
}
@end
